/**
 * indexDB添加数失败错误类
 */
export default class IndexDBConstraintError extends Error{
    constructor(dbName: string, tableName: string, version: number, field: string, originalError: DOMException | null) {
        const msg = originalError ? `\n\tErrorType: ${originalError.name}\n\tErrorInfo: ${originalError.message}\n\tStack: ${originalError.stack}` : "";
        super(`${msg}\n\t DatabaseName: ${dbName} \n\t StoreName: ${tableName} \n\t DatabaseVersion: ${version}\n\t IndexField: ${field}`);
        Object.setPrototypeOf(this, IndexDBConstraintError.prototype);
    }
}